package com.web.music.portal.mvc;

import java.util.Date;

import com.web.music.interfaces.UserService;
import com.web.music.model.User;

public class InitMusicController {
	
	private UserService userService;

	public void init() {
		if (! userService.existsAdminAccount()) {
			User adminUser = new User();
			adminUser.setIsAdmin("Y");
			adminUser.setUserName("root");
			adminUser.setPassword("root1");
			adminUser.setRegistered(new Date());
			userService.save(adminUser);
		}
	}

	public UserService getUserService() {
		return userService;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	
}